<template>
    <div class="navbar full text-left clearfix" style="line-height: 60px;padding-left: 20px">
      <el-button type="primary" @click="savePaper" class="fr" style="margin-top: 10px;margin-right: 30px">
        <i class="fa fa-save" /> &nbsp;保存
      </el-button>
    </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  name: 'Navbar',
  computed: {
    ...mapState(
      {
        selectedPapers: ({ paper }) => paper.selectedPapers
      }
    ),
    selected () {
      return this.selectedPapers.length === 0
    }
  },
  methods: {
    savePaper () {
      this.$bus.$emit('save-paper')
    }
  }
}
</script>
